package com.trhui.mallbook.client;

import com.trhui.mallbook.domain.common.ApiRequest;
import com.trhui.mallbook.domain.common.BaseResponse;
import com.trhui.mallbook.domain.request.yb.QueryMerchantStatusRequest;
import com.trhui.mallbook.domain.request.yb.YbMerchantUnfreezeApplyRequest;
import com.trhui.mallbook.domain.response.yb.YbMerchantUnfreezeApplyResponse;
import com.trhui.mallbook.enums.ChannelTypeEnum;
import com.trhui.mallbook.enums.ServerCodeEnum;

/**
 * 商户解冻相关接口
 *
 */
public class MerchantUnfreezeClient extends AbstractClient {

    /**
     * 申请解冻
     *
     */
    public static BaseResponse<YbMerchantUnfreezeApplyResponse> applyUnfreeze(YbMerchantUnfreezeApplyRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.MERCHANT_UNFREEZE_APPLY)
                .channelType(ChannelTypeEnum.YB)
                .build();
        return post(apiRequest, YbMerchantUnfreezeApplyResponse.class);
    }

    /**
     * 商户渠道状态查询
     */
    public static BaseResponse<YbMerchantUnfreezeApplyResponse> queryMerchantStatus(QueryMerchantStatusRequest request) {
        ApiRequest apiRequest = new ApiRequest.ApiRequestBuild()
                .merOrderId(request.getMerOrderId())
                .merchantNo(request.getMerchantNo())
                .params(request)
                .serverCode(ServerCodeEnum.QUERY_MERCHANT_STATUS)
                .channelType(ChannelTypeEnum.YB)
                .build();
        return post(apiRequest, YbMerchantUnfreezeApplyResponse.class);
    }




}
